package com.hqyj.springtest.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hqyj.springtest.mapper.SchoolMapper;
import com.hqyj.springtest.pojo.School;



@Service
public class SchoolService {
	
	@Autowired
	SchoolMapper sm;
	
	public List<School> getAllSchool(){
		return sm.selectByExample(null);
	}

	public int delSchool(int sid) {
		return sm.deleteByPrimaryKey(sid);
	}

	public int addScholl(School sch) {
		return sm.insert(sch);
	}
	
	public int updateSchool(School sch) {
		return sm.updateByPrimaryKeySelective(sch);
	}
}
